<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>流程管理</title>

    <!-- Bootstrap -->
    <link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/content.css}" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
</head>
<body>
<script type="text/javascript" th:inline="javascript">
    function delComfirm(id) {

        var basePath = [[@{/employee/delDeployment}]] + "/" + id;

        if (confirm("您确定要删除该流程吗")) {
            $("#delDep").attr("href",basePath);
        }else{
            $("#delDep").attr("href","#");
        }

    }
</script>
<!--路径导航-->
<ol class="breadcrumb breadcrumb_nav">
    <li>首页</li>
    <li>流程管理</li>
    <li class="active">查看流程</li>
</ol>
<!--路径导航-->

<div class="page-content">
    <form class="form-inline">
        <div class="panel panel-default">
            <div class="panel-heading">部署信息管理列表</div>

            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th width="10%">ID</th>
                        <th width="60%">流程名称</th>
                        <th width="20%">发布时间</th>
                        <th width="10%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="dep:${depList}">
                        <td th:text="${dep.getId()}">${dep.id}</td>
                        <td th:text="${dep.getName()}">${dep.name}</td>
                        <td th:text="${#dates.format(dep.getDeploymentTime(),'yyyy-MM-dd HH:mm:ss')}">2018-04-25</td>
                        <td>
                            <a th:href="@{|/employee/delDeployment/${dep.getId()}|}"
                               th:onclick="delComfirm([[${dep.getId()}]])" class="btn btn-danger btn-xs" id="delDep">
                                <span class="glyphicon glyphicon-remove"></span> 删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </form>

    <form class="form-inline">
        <div class="panel panel-default">
            <div class="panel-heading">流程定义信息列表</div>

            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th width="12%">ID</th>
                        <th width="18%">名称</th>
                        <th width="10%">流程定义的KEY</th>
                        <th width="10%">流程定义的版本</th>
                        <th width="15%">流程定义的规则文件名称</th>
                        <th width="15%">流程定义的规则图片名称</th>
                        <th width="10%">部署ID</th>
                        <th width="10%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="pd:${pdList}">
                        <td th:text="${pd.id}">${pd.id}</td>
                        <td th:text="${pd.name}">${pd.name}</td>
                        <td th:text="${pd.key}">${pd.key}</td>
                        <td th:text="${pd.version}">${pd.version}</td>
                        <td th:text="${pd.resourceName}">${pd.resourceName}</td>
                        <td th:text="${pd.diagramResourceName}">${pd.diagramResourceName}</td>
                        <td th:text="${pd.deploymentId}">${pd.deploymentId}</td>
                        <td>
                            <a target="_blank"
                               th:href="@{|/employee/viewImage/${pd.getDeploymentId()}/${pd.getDiagramResourceName()}|}"
                               class="btn btn-success btn-xs"><span class="glyphicon glyphicon-eye-open"></span>
                                查看流程定义图</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </form>

</div>
</body>
</html>